package com.sysd.config;

import com.sysd.context.UserContext;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: open feign 互相传输token
 * @author: bsh
 * @date: 2025/5/30 11:41
 */
@Configuration
public class OpenFeignConfig {
    @Bean
    public RequestInterceptor requestInterceptor() {
        return template -> {
            template.header("token", UserContext.getLoginUser().getToken());
        };
    }
}
